package com.wjy.sfhcore.itf.impl;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.wjy.sfhcore.itf.IntentListener;
import com.wjy.sfhcore.ui.activity.CoreActivity;


public class IntentFactory implements IntentListener {
    private Context context;

    public IntentFactory(Context context) {
        this.context = context;
    }

    public void goToOthers(Class<?> cls) {
        goToOthers(cls, null);
    }

    public void goToOthersF(Class<?> cls) {
        goToOthers(cls);
        ((Activity) context).finish();
    }

    public void goToOthers(Class<?> cls, Bundle bundle) {
        Intent intent = new Intent(context, cls);
        intent.putExtra(CoreActivity.PARAM_INTENT, bundle);
        context.startActivity(intent);
    }

    public void goToOthersF(Class<?> cls, Bundle bundle) {
        goToOthers(cls, bundle);
        ((Activity) context).finish();
    }


    public void addFragment(Fragment fragment) {

    }

    public void replaceFragment(Fragment newFragment) {

    }

    public void replaceFragment(Fragment newFragment, boolean addToBackStack) {

    }

    public void replaceFragment(int contentID, Fragment newFragment,
                                boolean addToBackStack) {

    }

    public void goToOthersForResult(Class<?> cls, Bundle bundle, int requestCode) {

    }

    public void backForResult(Class<?> cls, Bundle bundle, int resultCode) {

    }


}
